from time  import time

def bubble(name):
    beg = time()
    with open(name) as f:
        a = []
        for line in f:
            a.append([int(x) for x in line.split()])
    for i in range(len(a)):
        for j in range(len(a)-i-1):
            if a[j] > a[j+1]:
                a[j], a[j+1] = a[j+1], a[j]
    #print(a)
    end = time()
    t = end - beg
    print('time ', name, ':', t)

bubble('m1_storted.txt')
bubble('m2_reverse.txt')
bubble('m3_shuffle.txt')
